package dingadmin

import (
	"github.com/gofiber/template/html"
	"html/template"
)

func (i *Engine) addFuncs(e *html.Engine) {
	e.AddFunc("Get_Name", func() template.HTML {
		return template.HTML(i.configData.Name)
	})
	e.AddFunc("Get_Footer", func() template.HTML {
		return i.configData.Footer
	})
	e.AddFunc("Get_Version", func() template.HTML {
		return template.HTML(i.configData.Version)
	})
	e.AddFunc("Get_Prefix", func() template.HTML {
		return template.HTML(i.prefix)
	})
	e.AddFunc("Get_AsideMenus", func() []AsideMenu {
		return i.asideMenus
	})
	e.AddFunc("Get_Logo", func() string {
		return i.configData.Logo
	})
	e.AddFunc("Get_MessageNum", func() int {
		return len(i.messages)
	})
	e.AddFunc("Get_Messages", func() []TopMessage {
		return i.messages
	})
	e.AddFunc("Get_SearchPath", func() string {
		return i.configData.SearchPath
	})
}
